home *** CD-ROM | disk | FTP | other *** search
- #!perl -w
- # Special MPW glue
- undef;
-
- package MakeSource;
-
- require Exporter;
- @ISA = 'Exporter';
- @EXPORT = qw(MakeSource);
-
- # MakeSource
-
- use SourceList;
-
- use strict;
-
- Main() unless caller;
-
- sub Main {
- my $output = MakeSource(@ARGV);
- foreach (@$output) {
- print;
- }
- }
-
- sub MakeSource {
- my ($sourcesref) = SourceList::Sources(@_);
- my (%pathnames, @files);
- my @output;
- push @output, "# Make statements generated automatically by MakeSource.\n\n";
- foreach my $src (@$sourcesref) {
- my $pathname = $src->{DIR};
- my $filename = $src->{FILE};
- my $ext = '';
- $filename =~ /\.(\w+)$/ and $ext = $1;
- push @{$pathnames{$ext}}, $pathname unless grep { $_ eq $pathname; } @{$pathnames{$ext}};
- push @files, $filename;
- }
- foreach my $ext (sort keys %pathnames) {
- length $ext or $ext = "NULL";
- push @output, ".SOURCE.$ext : "
- . join('', '"', join('" "', @{$pathnames{$ext}}), '"', "\n");
- }
- push @output, "\n";
- push @output, "SRCS = " . join(' ', @files) . "\n";
-
- return \@output;
- }
-
- 1;
-